export default function request(url, options = {}) {
    wx.showLoading({
        title: '加载中....',
    });
    let baseUrl = 'https://api-hmugo-web.itheima.net/api/public/v1'
    //主题逻辑
    return new Promise((resolve, reject) => {
        wx.request({
            url: baseUrl + url,
            data: options.params,
            header: {
                'content-type': 'application/json'
            },
            method: options.method,

            success: (result) => {
                resolve(result.data.message)
            },
            fail: (err) => {
                reject(err)
            },
            complete: () => {
                wx.hideLoading()
            }
        })
    })
}